package appfight.map;

import braindamagestudio.com.app.fight.MainGameActivity;
import appfight.level.GameLevelMap;
import appfight.level.LevelFactory;
import appfight.map.GameObjectMap.Map_Object;

public class ChangeSceneObject extends MapObject{

	private GameLevelMap _level;
	private String _changeLevelName;
	private int _changedPositionX;
	private int _changedPositionY;
	
	public ChangeSceneObject(Map_Object objectType,GameLevelMap level,String changeLevelName,int changedPositionX,int changedPositionY) {
		super(objectType);
		_level = level;
		_changeLevelName = changeLevelName;
		_changedPositionX = changedPositionX;
		_changedPositionY = changedPositionY;
	}
	
	@Override
	public void Action()
	{
		_level._camera.setChaseEntity(null);
		GameLevelMap nextLevel = (GameLevelMap)LevelFactory.GetLevel(_changeLevelName);
		MainGameActivity.changedSceneCharacterX = _changedPositionX;
		MainGameActivity.changedSceneCharacterY = _changedPositionY;
		_level.ChangeLevel(nextLevel);
	}

}
